//
//  HomePageCollectionViewModel.m
//  InSuger
//
//  Created by dllo on 15/11/28.
//  Copyright © 2015年 Dior_3g. All rights reserved.
//

#import "HomePageCollectionViewModel.h"

@implementation HomePageCollectionViewModel

- (void)encodeWithCoder:(NSCoder *)aCoder {
    
    [aCoder encodeObject:self.pic1 forKey:@"pic1"];
    [aCoder encodeObject:self.share_url forKey:@"share_url"];
    [aCoder encodeObject:self.type forKey:@"type"];

}

- (id)initWithCoder:(NSCoder *)aDecoder {
    
    self = [super init];
    if (self) {
        
        //      解码的操作
        //      把解码之后的值再赋值给属性
        
        self.pic1 = [aDecoder decodeObjectForKey:@"pic1"];
        self.share_url = [aDecoder decodeObjectForKey:@"share_url"];
        self.type = [aDecoder decodeObjectForKey:@"type"];
        
    }
    return self;
    
}

- (instancetype)initWithPic1:(NSString *)pic1 share_url:(NSString *)share_url type:(NSString *)type {
    
    self = [super init];
    
    if (self) {
        
        self.pic1 = pic1;
        self.share_url = share_url;
        self.type = type;
        
    }
    return self;
    
}

@end
